package com.ds.api.utils;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Framework {

    private static final Logger logger = Logger.getLogger(Framework.class);

    private static ApplicationContext acx;

    static {
        // 读取spring-bean的配置文件
        logger.info("开始读取applicationContext.xml...");
        acx = new ClassPathXmlApplicationContext("applicationContext.xml");
        logger.info("读取applicationContext.xml配置文件完毕...");
    }

    public static ApplicationContext getDaoFactory() {
        // 获取spring的上下文
        return acx;
    }
}
